\section{Design}
\label{sec:design}
Previous empirical studies have demonstrated the feasibility of distinguishing ZigBee by its specific features.
This section details the design of IALPL.



\begin{figure}[t]
\centering
\includegraphics[width=3.0in]{figure/System.pdf}
\caption{Overview of IALPL}
\label{fig:overviewIALPL}
\end{figure}



\subsection{Overview}
\label{subsec:DesignOverview}
The overview of IALPL system is presented in Figure \ref{fig:overviewIALPL}.
IALPL provides an interface for application calls.
Upon receiving an assessment request, IALPL turns on radio, sampling received energy strength.
The obtained RSSI sequence is fed into segmentation component for identifying a set of segments correspond to signals.
Feature calculation component extracts features listed in Table \ref{tab:features}, taking the obtained set of segments as input.
Then matching component leverages the extracted features to decide whether ZigBee exists or not and return the result.

%
%Node with IALPL starts Interferene-Aware CCA (IACCA) after checking timer fired.
%IACCA samples the RSSI of channel quickly, and then put the RSSI sequence into online matching component.
%The matching component judge the sequence contains ZigBee signal or not.
%If contains, output YES; otherwise, output NO.
%Then the LPL decides sleep or keep on radio based on the output.
%As previous methods do, IACCA also integrates packet reception and SFD detection.
%That is, during sampling RSSI, if a packet received interrupt or SFD interrupt occurs, it means on-going transmission contains ZigBee.
%Hence, IACCA return YES immediately.


\subsection{Sampling}
\label{subsec:designSampling}
When receiving a channel checking request from applications, IALPL turns on radio and starts sampling.
After radio on, sampling component repeats reading the RSSI register in CC2420 chip for certain time.
To obtain enough samples and the resolution of DIFS in 802.11, we modify the CC2420 radio driver and SPI clock in TinyOS 2.1.2 for high sampling rate.
In IALPL, the sampling rate is increased to 31.25 KHz, i.e., 32us/sample.


\subsection{Segmentation}
\label{subsec:designSegment}
Segmentation identifies the segments correspond to signals for further calculation.
Our method of finding segments is similar to packet detection in wireless communication systems.
In communication, to detect the beginning of a packet, the receiver computes the average received energy during small duration.
If the difference between this energy and noise floor is larger than a threshold, receiver detects the beginning of a packet.
Similarly, the receiver detects the end of the packet when the difference between energy and noise floor falls below a threshold.
Likewise, in our system, the segments correspond to signal first increase and then decrease.
IALPL receiver detects a segment beginning when RSSI is 3 dB larger than the noise floor and detects a segment ending when the different between RSSi and noise is smaller than 3 dB.
During segmentation, we record the segment's attributes: start and end positions, average, maximum and minimum RSSI for feature calculation.
To eliminate the impact that the start position or end position is out of our sampling window, we add two samples with RSSI equal to noise floor at the start and end of sampling window.


\subsection{Feature calculation}

Feature calculation component takes segments together with their attributes as input and calculates the features listed in Table \ref{tab:features}.
Denote the RSSI sequence collected in sampling as:
$X = {x_{1}, x_{1}, ..., x_{W}}$, where $W$ is the sampling window size.
Then, the sets of start positions and end positions of segments are:
\begin{equation} \label{eq:startPositions}
I_{S} = \{s|x_{s-1} < Noise + T_{d}, x_{s} \geq Noise + th_{d} \}
\end{equation}
\begin{equation} \label{eq:endPositions}
I_{E} = \{e|x_{e-1} < Noise + T_{d}, x_{e} \geq Noise + th_{d} \}
\end{equation}
where $Noise$ is the RSSI of noise floor and $th_{d}$ is the threshold for detecting segment, as explained in previous section.
Since we eliminate the impact that the start or end position is outside the sampling window, both start and end position exist, i.e., $|I_{S}|=|I_{E}| = K$.

\textbf{On-air time}. The on-air time of segment $k$ can be calculate as:

\begin{equation} \label{eq:size}
T_{on}(k) = (I_{E}(k)-I_{S}(k))\cdot F_{s}
\end{equation}
where $F_{s}$ is the sampling frequency.

\textbf{MPI}. To calculate the MPI, the segments belong to same signal source should be identified.
Since IALPL get samples in several milliseconds, we can assume the RSSI of same signal source does not change in short time.
Therefore, we regard the segments with equal average RSSI belong to same signal source.
Then we calculate the MPI using the segments that pertain to same signal source.
MPI of same signal source could be calculate as:
\begin{equation} \label{eq:MPI}
T_{MPI} = min  \bigg{\{}(i-j) \bigg{|} \Big{|} \overline{E_{i}} - \overline{E_{j}} \Big{|} < th_{s}, 1\leq j<i\leq K \bigg{\}}
\end{equation}
where $th_{s}$ is the threshold of different between two segments for deciding the same signal source,
and $\overline{E_{i}}$ and $\overline{E_{j}}$ are the average RSSI values of segment $i$ and $j$ separately, which is calculated by:
\begin{equation} \label{eq:averageRSSI}
\overline{E_{k}} = \frac{\sum_{m=I_{S}(k)}^{I_{E}(k)} x_{m}} {I_{E}(k)-I_{S}(k)}
\end{equation}

\textbf{PAPR}. Peak to Average Power Ratio (PAPR) is a widely used cost function for evaluating multicarrier systems since its feasibility of measuring amplitude fluctuations.
PAPR of segment $k$ is defined as: 
\begin{equation} \label{eq:PAPR}
PAPR(k) = \frac{\max \{ x_{l}^{2} | I_{S}(k) \leq l \leq  I_{E}(k) \} } { E[X_{k}^{2}] }
\end{equation}
where $E[ . ]$ denotes taking the expected value and $X_{k}$ represents the RSSI sequence of segment $k$.
%
%Detection of the high RSSI sequences is straight-forward.
%However, correlating the high sequences to the same devices is not easy.
%In feature calculation, we only care about these sequences that may be resulted by ZigBee, which means the flat sequences.
%Hence, we filter some impossible samples to reduce the complexity of classification in matching step.
%Besides, feature calculation correlates the samples by average RSSI, length of sequence and range.
%The sequences with similar length, RSSI range and average RSSI are correlated to the same signal source.
%After assigning the high sequences to signal sources, feature calculation component can easily obtains the information listed in Table \ref{tab:features}.
%For more efficient classifier, we transform the information into binary features as following.
%(1) $L < L_{min}$; (2) $L > L_{max}$; (3) $MPI < MPI_{ZigBee}$; (4) $MPI > MPI_{ZigBee}$; (5) $range < Range_{ZigBee}$.
%$L$ is the on-air time, $L_{min}$ and $L_{max}$ are respectively the minimum and maximum on-air time of ZigBee packet.
%$MPI_{ZigBee}$ is the fixed MPI of ZigBee, which is 2.8 ms in our setting.
%$Range_{ZigBee}$ is the maximum fluctuation of the high RSSI sequence of ZigBee, which is 5 dBm in our setting.
%

%
%\begin{table}[t]
%\centering
%\caption{Classification result of decision tree}
%\vspace{1mm}
%\begin{tabular*}{8cm}{|>{\centering}p{1.5cm}|>{\centering}p{1.0cm}|>{\centering}p{1.15cm}|p{1.15cm}<{\centering}|p{1cm}<{\centering}|}
%\hline
% & ZigBee & Bluetooth & Microwave & WiFi\\
%%\hline
%\hline
%ZigBee         & 97.8\%     &   0           &    2.1\%      &  0 \\
%\hline
%Bluetooth      &   0.1\%    &    71.3\%     &    1.5\%      & 27.1\% \\
%\hline
%Microwave      &   0        &    13.5\%     &    70.0\%     & 16.5\%  \\
%\hline
%WiFi           &   0        &     1.6\%     &    0.2\%      & 98.2\%  \\
%\hline
%\end{tabular*}
%\label{tab:resultDT}
%\end{table}
%
%\begin{table*}[t]
%\centering
%\caption{Classification result of decision tree}
%\begin{tabular}{|c|c|c|c|c|c|}
%\hline
%Features                &   True positive   &   False positive  &   True negative   &     False negative \\
%\hline
%PAPR+On-air time+MPI    &   97.8\%          &   0.1\%           &   99\%            &     2.2\%     \\
%\hline
%PAPR+Pn-air time        &   97.8\%          &   0.6\%           &   99.4\%          &     2.2\%     \\
%\hline
%PAPR                    &   97.8\%          &   3.6\%           &   96.4\%          &     2.2\%     \\
%\hline
%\end{tabular}
%\label{tab:resultDT}
%\end{table*}



\begin{figure}[t]
\centering
\includegraphics[width=3.0in]{figure/ZigBeeRecognazition.pdf}
\caption{Illustration of recognizing ZiBee}
\label{fig:recogZigBee}
\end{figure}


\begin{table}[t]
\centering
\caption{Classification result of decision tree}
\begin{tabular}{|c|c|c|c|}
\hline
Features                &   True positive rate  &   False positive rate\\
\hline
PAPR+On-air time+MPI    &   97.8\%          &   0.1\%        \\
\hline
PAPR+On-air time        &   97.8\%          &   0.6\%        \\
\hline
PAPR                    &   97.8\%          &   3.6\%        \\
\hline
\end{tabular}
\label{tab:resultDT}
\end{table}


\subsection{Matching}
Output of feature calculation is a set of signal sources together with the features.
Matching component make a judgement whether the sources contains ZigBee.
IALPL employs decision tree as the matching method. 
We collect 10455 labeled segments as training set and adopt C4.5 algorithm to create the decision tree. 


We first illustrate how to recognize ZigBee without interference, i.e., under white noise.
Then we demonstrate the feasibility to recognize ZigBee under interference, by showing ZigBee's distinguishable RSSI sequence.
Figure \ref{fig:recogZigBee} is an illustration diagram about recognizing ZigBee.
It contains six ZigBee packets, the lengthes of which are 96 Bytes for the first packet and 48 Bytes for the rest.
The dashed rectangles are sampling windows, marking the six possible sampled sequences:
(a) A flat segment with RSSI around the noise floor. 
IALPL decides there is no ZigBee in this case.
Actually, in this case, the output of feature calculation is an empty set.
(b) A flat segment with RSSI above noise floor. 
IALPL decides ZigBee exists due to such a long on-air time with small PAPR. 
(c) A flat segment with RSSI above noise floor, start and end position inside the sampling window.
In this case, IALPL check the historical valid packet length.
If there is a packet length resulting on-air time equal to the segment, IALPL regards it is a ZigBee. 
(d) Two flat segments with RSSI above noise floor at the beginning and end of sampling window. 
IALPL check the MPI to validate whether it equals to protocol specified MPI.
If the MPI is valid, IALPL regards ZigBee presents.
(e) and (f) A flat segment with RSSI above noise floor, one of start and end position lays in the sampling window and another one is outside the sampling window.
IALPL check the historical packet length. 
If there is valid packet length has on-air time longer or equal to the on-air time of this segment,
IALPL decides this is a ZigBee transmission. 

%Output of feature calculation is the set of signal sources with extracted features.
%Matching component takes the source set as input and judge whether ZigBee is in this set.
%SVM classifier presented in previous section can distinguish ZigBee accurately.
%However, it is infeasible to use in a resource-limited TelosB node.
%Therefore, we adopts C4.5 algorithm \cite{bib:C4.5} to create a decision tree from the training set.
%The decision tree is used in the online matching component.

%The false negative ratio is zero and the false positive is XXX, which is comparable to SVM.

\begin{figure}[t]
\centering
\includegraphics[width=3.0in]{figure/DecisionTree.pdf}
\caption{Decision tree created by C4.5}
\label{fig:decisionTree}
\end{figure}

Generally, we adopt the decision tree to distinguish ZigBee.
The algorithm adopted in our system is shown in Figure \ref{fig:decisionTree}.
Note that some MPI not presents all the time due to the short sampling window. 
For example, When MPI of ZigBee is 2.8 ms and sampling window is 2.9ms, only in case (c), MPI is available. 
Hence, to make sure ZigBee transmission is not ignored, IALPL makes conservative decisions. 
If a feature is missing, IALPL regards the segments meet this feature and goes further for next feature.
Even though this sacrifices certain degree accuracy, it brings no harm to other system performances such as latency.
Besides, if a valid segment exists, it always has PAPR and on-air time as features. 
We use C4.5 algorithm create the decision trees based on (1) all three features; (2) PAPR and on-air time; (3) only PAPR.
Table \ref{tab:resultDT} shows the accuracies of decision trees based on different set of features.
True positive ratio relates to detect ZigBee correctly.
And false positive ratio relates to non-ZigBee signal is classified as ZigBee.
Hence, ZigBee segments can be distinguished even only PAPR information is available.



\begin{figure*}
\centering
\subfigure[ZigBee and 802.11b]{\includegraphics[width=0.32\textwidth]{figure/80211bVSZigBee.pdf}}
\subfigure[ZigBee and 802.11n]{\includegraphics[width=0.32\textwidth]{figure/80211nVSZigBee.pdf}}
\subfigure[ZigBee and 802.11n]{\includegraphics[width=0.32\textwidth]{figure/80211nVSZigBee_Severe.pdf}}
\caption{RSSI patterns of overlapped transmissions}
\label{fig:overlappedRSSI}
\end{figure*}

\subsection{Dealing with some corner cases}
In previous design, we present the methods to distinguish ZigBee and some common technologies.
Even it is effective enough, some corner cases still need to be coped with to improve the detection accuracy further.

\begin{Situation}
\label{case:11b}
\textbf{WiFi beacon}.
During our empirical studies, we found that WiFi AP beacon shows a similar RSSI pattern to ZigBee transmissions.
An AP broadcasts a beacon every 100ms in default settings.
If a ZigBee receiver perform CCA when an AP broadcasts beacon, IALPL will improperly regard it as ZigBee transmission and wake up the node.

To cope with this case, we leverage the relatively fixed on-air time of valid packets in a sensor network system.
We notice that even valid ZigBee on-air time has a wide range, a system will not cover all possible on-air time.
In a real deployed system, only a few kinds of message is generated. 
Hence, there are only several valid packet lengths with ceratin on-air times.  
For example, in our previous deployed sensor systems \cite{bib:greenorbs} and \cite{bib:citysee}, XXXX kinds of messages are defined with XXXX valid packet lengths( same packet length for two kinds of messages).
On the other hand, the format of beacon packet specified by IEEE 802.11 standard has fixed length. 
Then, if no valid system packet length produce same on-air time, we can distinguish ZigBee by leveraging the possible valid on-air time.
IALPL records the possible packet lengths each time the node receive the valid packet and calculate the valid on-air time.
When identifying a segment has ZigBee features, we check it again by using the set of valid on-air times.

To validate the feasibility of this method, we measures the XXXX beacon packets from XXX APs.
The cumulated distribution function of on-air time is plotted in Figure XXX.
As shown in the figure, on-air time of beacon packets from same AP does not change much and different APs have a similar on-air time of beacon packets.
\end{Situation}


%
%\subsection{Dealing with other DSSS technique}
%In the co-existing environment, 802.11b is another common standard in 2.4GHz.
%It complies with the 802.11 standard which give distinguishable features such as shorter MPI.
%%IALPL can still leverage these features to differentiate ZigBee from 802.11b.
%However, when there is only one captured packet with the length that produces the on-air time in the range of valid ZigBee packet, 802.11b cannot be distinguished since the pattern is just the same to ZigBee.
%802.11b is not usually considered in previous work such as SoNIC.
%Nevertheless, we find that even 802.11b device does not exist, 802.11b is still adopted in 802.11g/n for beacon transmission of Access Points (APs).
%It must be coped with for reducing the false wakeups to the maximum extend, even this case does not usually occur.
%
%IALPL adopts two information to overcome the misjudgment of 802.11b.
%One is the set of the possible on-air time of system packets, ${L_{v}}$.
%IALPL records the possible packet lengths each time the node receive the valid packet.
%If a new valid packet length is found, IALPL calculates the corresponding on-air time $L_{v}$ and inserts it into the set.
%Since the packet length of AP's beacon is fixed, the on-air time of beacon is fixed.
%It can be used for distinguishing ZigBee packets if there is no valid packet with the same on-air time to the beacons.
%If in the extreme case where ZigBee packet has the same on-air time to the beacon, IALPL extends the RSSI sampling to another round to check whether the MPI of this high sequence is valid.
%If the source is ZigBee, after the fixed MPI, which is 2.8 ms in our setting, there must be a ZigBee RSSI pattern occurs.
%If there is no flat RSSI pattern, the source is a 802.11b.
%
%The other information used in IALPl is the set of beacon time of APs, ${T_{b}}$.
%In above process, if we judge the source is the beacon of AP, we record the $T_{b}$ if it is new.
%Notice that beacons of AP is periodical with the fixed period, which is 100 ms in default.
%Hence, IALPL leverages ${T_{b}}$ for later judging.
%Next time, if we get a confused sampling sequence without MPI information, we could see whether the starting time of this high sequence belongs to ${T_{b}+100}$.
%If it belongs, IALPL regards it as 802.11b or ZigBee otherwise.

%
%Unfortunately, due to the complicated channel states, it may encounters some practical challenges as follows.
%(The structure of this section will be presenting the solutions of the following challenges one by one.)
%
%Chanllenge1:
%ZigBee and 802.11b are confused since both of them use DSSS.
%
%Solution1:
%(1) Using 802.11 behavior. E.g., 802.11 has a inter-packet interval whose length is roughly one DIFS, which is much shorter than ZigBee preamble's interval.
%(2) Using spectral features. If during whole sampling period, only one packet's RSSI samples are obtained, (1) cannot work.
%we can use spectral features to speculate what the signal is.
%The insight is that 802.11b has 20MHz bandwidth while one channel of ZigBee is only 5MHz. Hence, we can jump to neighbor channel to sample the RSSI. If we get signal with comparable strength, it means the bandwidth of signal covers this channel, which is 802.11b; If we get some samples with much lower strength, it is leaking energy of ZigBee.

%\begin{figure}[t]
%\centering
%%\includegraphics[width=3in]{figure/draft-1.pdf}
%\caption{The overlapped RSSI pattern of ZigBee and 802.11b}
%\label{fig:overlappZigBee802.11b}
%\end{figure}
%
%\begin{figure}[t]
%\centering
%%\includegraphics[width=3in]{figure/draft-1.pdf}
%\caption{The overlapped RSSI pattern of ZigBee and 802.11g}
%\label{fig:overlappZigBee802.11g}
%\end{figure}
%
%\begin{figure}[t]
%\centering
%%\includegraphics[width=3in]{figure/draft-1.pdf}
%\caption{The overlapped RSSI pattern of ZigBee and 802.11g}
%\label{fig:overlappZigBee802.11gSevere}
%\end{figure}


\begin{Situation}
\label{case:smallDistortion}
\textbf{Overlapping}. 
Since co-existing technologies do not consider others when performing CSMA/CA, the senders of different technologies may transmit concurrently when they form hidden terminal, i.e., they cannot hear each other but the receiver can hear at least two senders.
Therefore, signals from different technologies may overlap together and produce irregular segments. 
Figure \ref{fig:overlappedRSSI} presents three examples: (a) the overlapped RSSI sequence of ZigBee and WiFi AP beacon; (b) the overlapped RSSI sequence of ZigBee and 802.11g, with ZigBee segment in sampling window; (c) the overlapped RSSI sequence of ZigBee and 802.11g, without ZigBee segment in sampling window.

To cope with the overlapped cases, IALPL exploits the asynchrony of transmissions from independent senders to separate ZigBee segments from overlapped segments.
The asynchrony refers to the fact that transmissions from the senders of different technologies in real world deployments rarely overlap with each other perfectly since the transmissions from independent senders will be very likely asynchronous \cite{bib:DOF}.

For case (a), IALPL detects the rising and falling edges.
A rising edge indicates a start of a signal and a falling edge indicates the end of a signal.
Hence, IALPl separate two segments from the overlapped segments, as the dashed lines shown in Figure \ref{fig:overlappedRSSI} (a).

For case (b), due to the large fluctuation of 802.11g, the strategy of detecting rising/falling edges ceases to be effective.
IALPL adopts another method to cope with this case.
The key observation to separate ZigBee sequence is:
during the packet interval of 802.11g, if there is no other transmission, the RSSI drops to the noise floor; while if there is other transmission, the RSSI will not drop to the noise floor.
We can measure the possible on-air time by regarding the starting time of ZigBee as the start of the high sequence which is followed by a packet interval with larger RSSI than noise floor, and the ending time of ZigBee as the end of the high sequence which follows a packet interval with larger RSSI than noise floor.
Therefore, we can get a range of possible on-air time.
IALPL regards a ZigBee transmission exists if there is a valid on-air time of the system in this range.
Otherwise, IALPL judges there is no ZigBee transmission.


Another corner case is that sampling sequence starts with a fluctuated RSSI sequence, resulting in the confusion whether it is a single 802.11g/n or a overlapped sequence of ZigBee and 802.11g/n, as shown in Figure \ref{fig:overlappedRSSI} (c).
In this case, we record the end of the this starting fluctuated sequence and calculate the remaining time.
If the remaining time is longer than the MPI of ZigBee, IALPL has a second chance to judge whether there is ZigBee after MPI time.
If it is shorter than the MPI, IALPL extends the CCA checking period to the time when next preamble transmission occurs to give another chance for judging the existence of ZigBee.
Note that the extended period won't longer than the on-air time of 802.11g/n which is 542 us.
Therefore, the additional energy consumption is very little.
Besides, since the probability of this case happens is low, the energy consumption of the extensions is negligible.
We will validate this in the evaluation.
\end{Situation}

%
%\subsection{Dealing with small distortions}
%Since co-existing technologies do not consider others when performing CSMA/CA, the senders of different technologies may transmit concurrently when they form hidden terminal, i.e., they cannot hear each other but the receiver can hear at least two senders.
%In this case, the high RSSI sequences of different technologies may overlap and produce a irregular RSSI pattern.
%Consequently, the classifier in matching component is not able to distinguish ZigBee since the irregular RSSI pattern may not fit for any pattern.
%In this section, we consider the case where ZigBee overlaps with other DSSS technologies which results in small distortions.
%We discuss the cases where ZigBee overlaps with other different modulation techniques which may result in severe distortions in the following section.
%
%Figure \ref{fig:overlappedRSSI} (a) presents the overlapped RSSI sequence of ZigBee and 802.11b.
%The overlapping results in distortions but not that severe due to the same modulation technique and the flat RSSI pattern of DSSS.
%IALPL exploits the asynchrony of transmissions from independent senders.
%The asynchrony refers to the fact that transmissions from the senders of different technologies in real world deployments rarely overlap with each other perfectly since the transmissions from independent senders will be very likely asynchronous as shown in Figure \ref{fig:overlappedRSSI} (a) \cite{bib:DOF}.
%IALPL exploits this idea to separate the individual RSSI sequences from the overlapped sequence by detecting the rising and falling edges.
%If a new signal starts interfering, RSSI is enhanced, leading to a rising edge.
%If a signal ends, RSSI is weaken, leading to a falling edge.
%By this way, individual RSSI sequences can be sequentially separated from the overlapped sequence.
%Then IALPL puts the separated sequences into feature calculation component for feature extraction.
%%
%Chanllenge2:
%Overlapping with DSSS signals(802.11b). Since 802.11b is similar to ZigBee, the distortion will not be severe.
%
%Solutions2:
%Sequential cancellation. If overlapping is detected. We separate signals by cancellation.
%And then judge all of the separated signal. If any of them is ZigBee or cannot be classified as interference, IALPL regards the ZigBee exists.


%
%\subsection{Dealing with severe distortions}
%When overlapping with non-DSSS transmissions, the RSSI sequence of ZigBee may be seriously distorted.
%If multiple OFDM packets are successively transmitted, ZigBee's transmission is easy to be hidden into the sequence of OFDM packets, resulting in a neglect of ZigBee.
%Figure \ref{fig:overlappedRSSI} (b) presents the overlapped RSSI sequence of ZigBee and 802.11g.
%Due to the large fluctuation of 802.11g, the strategy of detecting rising/falling edges ceases to be effective.
%IALPL adopts another method to cope with this case.
%The key observation to separate ZigBee sequence is:
%during the packet interval of 802.11g, if there is no other transmission, the RSSI drops to the noise floor; while if there is other transmission, the RSSI will not drop to the noise floor.
%We can measure the possible on-air time by regarding the starting time of ZigBee as the start of the high sequence which is followed by a packet interval with larger RSSI than noise floor, and the ending time of ZigBee as the end of the high sequence which follows a packet interval with larger RSSI than noise floor.
%Therefore, we can get a range of possible on-air time.
%Then, we can judge whether there is a valid packet length, $L_{v}$, in this range.
%We regard a ZigBee transmission exists if there is such a packet length.
%Otherwise, we judge there is no ZigBee transmission.
%
%Another corner case is that sampling sequence starts with a fluctuated RSSI sequence, resulting in the confusion whether it is a single 802.11g/n or a overlapped sequence of ZigBee and 802.11g/n, as shown in Figure \ref{fig:overlappedRSSI} (c).
%In this case, we record the end of the this starting fluctuated sequence and calculate the remaining time.
%If the remaining time is longer than the MPI of ZigBee, IALPL has a second chance to judge whether there is ZigBee after MPI time.
%If it is shorter than the MPI, IALPL extends the CCA checking period to the time when next preamble transmission occurs to give another chance for judging the existence of ZigBee.
%Note that the extended period won't longer than the on-air time of 802.11g/n which is 542 us.
%Therefore, the additional energy consumption is very little.
%Besides, since the probability of this case happens is low, the energy consumption of the extensions is negligible.
%We will validate this in the evaluation.
%
%Chanllenge3:
%Overlapping with non-DSSS signals. If ZigBee overlaps with other non-DSSS signals and the number of samples is not enough(e.g, the case where sampled high RSSIs are only at the very beginning or at the very end, with the number of samples less than some constant), IALPL cannot make sure whether there is ZigBee signal hides in the samples.
%
%Solution3:
%Adaptive sampling slot. IALPL keeps eyes on this case. During sampling, if this case happens, IALPL will immediately increase the sampling slot by 1 and try to get more information. If the case unfortunately happens again in next slot, we repeat the increasing until we get the maximum sampling slots which is a parameter that need to be optimized.


